package com.ztx.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class Utils {

	/**
	 * 生成主键
	 * 
	 * @return
	 */
	private static Random random = new Random();

	public static long createId() {
		return Math.abs(random.nextLong());
	}

	/**
	 * 返回指定格式的当前时间
	 * 
	 * @param format
	 * @return
	 */
	public static String getCurrentDatetime(String format) {
		SimpleDateFormat sdf = new SimpleDateFormat(format);
		return sdf.format(new Date());
	}

}
